package com.lecture.java8.excel.dyr.i;

public class Test {


    private static final String patternString = "^(?!.*(?:\\./|\\\\\\.|\\\\.\\\\|/\\.|//|\\\\\\.|\\\\\\\\))[a-zA-Z0-9./-]+$\n";
    private static final String patternString1 = "./|/.";

    public static String filePathFilter(String filepath){
        final String[] split = patternString1 .split("\\|");
        for(String s : split){
            filepath = filepath.replace(s,"");
        }
        if(filepath.matches(patternString)){
            return filepath;
        }
        return null;
    }

    public static void main(String[] args) {
        System.out.println(filePathFilter("/homt/tmp"));
    }
}
